<h2>Teachers</h2>

<table id="sub" class="tablesorter"><thead class = "forms">
<tr><th>Name</th><th>E-mail Address</th><th>About me</th><th>Academic Credentials</th><th>Mobile Number</th><th>Status</th><th>Registration Date</th></tr></thead><tbody>
<?php $i = 1;?>
<?php foreach($teachers->result() as $test){ ?>
		<tr><td><?php echo "<strong>".$test->lastname.",&nbsp".$test->firstname."</strong>";?></td>
		<td><?php echo $test->email; ?></td>
		<td><?php echo $test->aboutme; ?></td>
		<td><?php echo $test->academiccredentials; ?></td>
		<td><?php echo $test->mobilenumber; ?></td>
		<td><?php if($test->teacherstatus == "pending"){
				echo form_label('Pending', 'teacherstatus'.$i);
			} elseif($test->teacherstatus == "approved") {
				echo form_label('Approved', 'teacherstatus'.$i);
			} else {
				echo form_label('Rejected', 'teacherstatus'.$i);
			}
		;?></td>
		<td><?php echo $test->regtime; ?></td>
		</tr>
		<?php $i++;?>
<?php	} ?>
</tbody>
</table>

<br><br><br>
<?php echo form_open('admin/update_teacher_status'); ?>
<h3>Approve/Reject Teachers</h3>
<table id="sub" class="tablesorter"><thead class = "forms">
<tr><th>Name</th><th>E-mail</th><th>Status</th><th>Academic Credentials</th></tr></thead><tbody>
<?php $i = 1;?>
<?php foreach($pending->result() as $test){ ?>
		<tr><td><?php echo $test->lastname.",&nbsp".$test->firstname;?></td>
		<td><?php echo $test->email;?></td>
		<td><?php echo form_radio('teacherstatus'.$i, 'pending', $test->teacherstatus == 'pending' ? TRUE : FALSE) . 'Pending'; echo "&nbsp;&nbsp;";
	echo form_radio('teacherstatus'.$i, 'approved', $test->teacherstatus == 'approved' ? TRUE : FALSE) . 'Approve';
	echo form_radio('teacherstatus'.$i, 'rejected', $test->teacherstatus == 'rejected' ? TRUE : FALSE) . 'Reject'; ?></td>
		<td><?php echo $test->academiccredentials; ?></td>
		</tr>
		<?php $i++;?>
<?php	} ?>
</tbody>
</table>
<?php echo form_submit('update', 'Take Action'); ?>
<?php echo form_close(); ?>
